home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat1 / bsh.z / bsh
Text File  |  1998-10-30  |  71KB  |  1,255 lines

  1.  
  2.  
  3.  
  4. bbbbsssshhhh((((1111))))                                                                  bbbbsssshhhh((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _bbbb_ssss_hhhh_,,,, _jjjj_ssss_hhhh - shell, the standard/job control command programming language
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _bbbb_ssss_hhhh [ ----aaaacccceeeeffffhhhhiiiikkkknnnnpppprrrrssssttttuuuuvvvvxxxx ] [ args ]
  13.      _jjjj_ssss_hhhh [ ----aaaacccceeeeffffhhhhiiiikkkknnnnpppprrrrssssttttuuuuvvvvxxxx ] [ args ]
  14.  
  15. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  16.      NNNNooootttteeee:::: This is the Bourne shell description. All references to _s_h and
  17.      _s_h_e_l_l pertain to _b_s_h and all references below to /_u_s_r/_l_i_b/_r_s_h, the
  18.      restricted shell, no longer apply to the Bourne shell. (See _ssss_hhhh_((((_1111_))))).
  19.  
  20.      _b_s_h is a command programming language that executes commands read from a
  21.      terminal or a file.
  22.  
  23.      _j_s_h is an interface to the shell that provides all the functionality of
  24.      _s_h and enables Job Control (see JJJJoooobbbb CCCCoooonnnnttttrrrroooollll below).
  25.  
  26.      See IIIInnnnvvvvooooccccaaaattttiiiioooonnnn below for the meaning of arguments to the shell.
  27.  
  28.      See CCCCAAAAVVVVEEEEAAAATTTTSSSS below for interaction with Korn shell builtins.
  29.  
  30.    DDDDeeeeffffiiiinnnniiiittttiiiioooonnnnssss
  31.      A _b_l_a_n_k is a tab or a space.  A _n_a_m_e is a sequence of letters, digits, or
  32.      underscores beginning with a letter or underscore.  A _p_a_r_a_m_e_t_e_r is a
  33.      name, a digit, or any of the characters ****, @@@@, ####, ????, ----, $$$$, and !!!! ....
  34.  
  35.    CCCCoooommmmmmmmaaaannnnddddssss
  36.      A _s_i_m_p_l_e-_c_o_m_m_a_n_d is a sequence of non-blank _w_o_r_d_s separated by _b_l_a_n_k_s.
  37.      The first word specifies the name of the command to be executed.  Except
  38.      as specified below, the remaining words are passed as arguments to the
  39.      invoked command.  The command name is passed as argument 0 (see _e_x_e_c(2)).
  40.      The _v_a_l_u_e of a _s_i_m_p_l_e-_c_o_m_m_a_n_d is its exit status if it terminates
  41.      normally, or (octal) 200+_s_t_a_t_u_s if it terminates abnormally (see
  42.      _s_i_g_n_a_l(2) for a list of status values).
  43.  
  44.      A _p_i_p_e_l_i_n_e is a sequence of one or more _c_o_m_m_a_n_d_s separated by ||||.  The
  45.      standard output of each command but the last is connected by a _p_i_p_e(2) to
  46.      the standard input of the next command.  Each command is run as a
  47.      separate process; the shell waits for the last command to terminate.  The
  48.      exit status of a pipeline is the exit status of the last command.
  49.  
  50.      A _l_i_s_t is a sequence of one or more pipelines separated by ;;;;, &&&&, &&&&&&&&, or
  51.      ||||||||, and optionally terminated by ;;;; or &&&&.  Of these four symbols, ;;;; and &&&&
  52.      have equal precedence, which is lower than that of &&&&&&&& and ||||||||.  The
  53.      symbols &&&&&&&& and |||||||| also have equal precedence.  A semicolon (;;;;) causes
  54.      sequential execution of the preceding pipeline; an ampersand (&&&&) causes
  55.      asynchronous execution of the preceding pipeline (that is, the shell does
  56.      _n_o_t wait for that pipeline to finish).  The symbol &&&&&&&& (||||||||) causes the
  57.      _l_i_s_t following it to be executed only if the preceding pipeline returns a
  58.      zero (nonzero) exit status.  An arbitrary number of newlines can appear
  59.      in a _l_i_s_t, instead of semicolons, to delimit commands.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. bbbbsssshhhh((((1111))))                                                                  bbbbsssshhhh((((1111))))
  71.  
  72.  
  73.  
  74.      A _c_o_m_m_a_n_d is either a _s_i_m_p_l_e-_c_o_m_m_a_n_d or one of the following.  Unless
  75.      otherwise stated, the value returned by a command is that of the last
  76.      _s_i_m_p_l_e-_c_o_m_m_a_n_d executed in the command.
  77.  
  78.      ffffoooorrrr _n_a_m_e [ iiiinnnn _w_o_r_d ... ] ddddoooo _l_i_s_t ddddoooonnnneeee
  79.                Each time a ffffoooorrrr command is executed, _n_a_m_e is set to the next
  80.                _w_o_r_d taken from the iiiinnnn _w_o_r_d list.  If iiiinnnn _w_o_r_d ...  is omitted,
  81.                the ffffoooorrrr command executes the ddddoooo _l_i_s_t once for each positional
  82.                parameter that is set (see PPPPaaaarrrraaaammmmeeeetttteeeerrrr SSSSuuuubbbbssssttttiiiittttuuuuttttiiiioooonnnn below).
  83.                Execution ends when there are no more words in the list.
  84.  
  85.      ccccaaaasssseeee _w_o_r_d iiiinnnn [ _p_a_t_t_e_r_n [ | _p_a_t_t_e_r_n ] ...)))) _l_i_s_t ;;;;;;;; ] ... eeeessssaaaacccc
  86.                A ccccaaaasssseeee command executes the _l_i_s_t associated with the first
  87.                _p_a_t_t_e_r_n that matches _w_o_r_d.  The form of the patterns is the
  88.                same as that used for filename generation (see FFFFiiiilllleeeennnnaaaammmmeeee
  89.                GGGGeeeennnneeeerrrraaaattttiiiioooonnnn) except that a slash, a leading dot, or a dot
  90.                immediately following a slash need not be matched explicitly.
  91.  
  92.      iiiiffff _l_i_s_t tttthhhheeeennnn _l_i_s_t [ eeeelllliiiiffff _l_i_s_t tttthhhheeeennnn _l_i_s_t ] ... [ eeeellllsssseeee _l_i_s_t ] ffffiiii
  93.                The _l_i_s_t following iiiiffff is executed and, if it returns a zero
  94.                exit status, the _l_i_s_t following the first tttthhhheeeennnn is executed.
  95.                Otherwise, the _l_i_s_t following eeeelllliiiiffff is executed and, if its
  96.                value is zero, the _l_i_s_t following the next tttthhhheeeennnn is executed.
  97.                Failing that, the eeeellllsssseeee _l_i_s_t is executed.  If no eeeellllsssseeee _l_i_s_t or
  98.                tttthhhheeeennnn _l_i_s_t is executed, the iiiiffff command returns a zero exit
  99.                status.
  100.  
  101.      wwwwhhhhiiiilllleeee _l_i_s_t ddddoooo _l_i_s_t ddddoooonnnneeee
  102.                A wwwwhhhhiiiilllleeee command repeatedly executes the wwwwhhhhiiiilllleeee _l_i_s_t and, if the
  103.                exit status of the last command in the list is zero, executes
  104.                the ddddoooo _l_i_s_t; otherwise the loop terminates.  If no commands in
  105.                the ddddoooo _l_i_s_t are executed, the wwwwhhhhiiiilllleeee command returns a zero exit
  106.                status; uuuunnnnttttiiiillll can be used in place of wwwwhhhhiiiilllleeee to negate the loop
  107.                termination test.
  108.  
  109.      ((((_l_i_s_t))))    Execute _l_i_s_t in a subshell.
  110.  
  111.      {{{{_l_i_s_t;;;;}}}}   _l_i_s_t is executed in the current (that is, parent) shell.  The {{{{
  112.                must be followed by a space.
  113.  
  114.      _n_a_m_e (((()))) {{{{_l_i_s_t;;;;}}}}
  115.                Define a function that is referenced by _n_a_m_e.  The body of the
  116.                function is the _l_i_s_t of commands between {{{{ and }}}}.  The _l_i_s_t can
  117.                appear on the same line as the _{{{{.  If it does, the {{{{ and _l_i_s_t
  118.                must be separated by a space.  The }}}} cannot be on the same line
  119.                as _l_i_s_t; it must be on a newline.  Execution of functions is
  120.                described below (see EEEExxxxeeeeccccuuuuttttiiiioooonnnn).  The _{{{{ and _}}}} are unnecessary
  121.                if the body of the function is a _c_o_m_m_a_n_d as defined above,
  122.                under CCCCoooommmmmmmmaaaannnnddddssss.
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. bbbbsssshhhh((((1111))))                                                                  bbbbsssshhhh((((1111))))
  137.  
  138.  
  139.  
  140.      The following words are only recognized as the first word of a command
  141.      and when not quoted:
  142.  
  143.           iiiiffff tttthhhheeeennnn eeeellllsssseeee eeeelllliiiiffff ffffiiii ccccaaaasssseeee eeeessssaaaacccc ffffoooorrrr wwwwhhhhiiiilllleeee uuuunnnnttttiiiillll ddddoooo ddddoooonnnneeee {{{{ }}}}
  144.  
  145.  
  146.    CCCCoooommmmmmmmeeeennnnttttssss
  147.      A word beginning with #### causes that word and all the following characters
  148.      up to a newline to be ignored.
  149.  
  150.    CCCCoooommmmmmmmaaaannnndddd SSSSuuuubbbbssssttttiiiittttuuuuttttiiiioooonnnn
  151.      The shell reads commands from the string between two grave accents (````````)
  152.      and the standard output from these commands can be used as all or part of
  153.      a word.  Trailing newlines from the standard output are removed.
  154.  
  155.      No interpretation is done on the string before the string is read, except
  156.      to remove backslashes (\\\\) used to escape other characters.  Backslashes
  157.      can be used to escape a grave accent (````) or another backslash (\\\\) and are
  158.      removed before the command string is read.  Escaping grave accents allows
  159.      nested command substitution.  If the command substitution lies within a
  160.      pair of double quotes ("""" ............ ````............```` ............ """"), a backslash used to escape a
  161.      double quote (\\\\"""") is removed; otherwise, it is left intact.
  162.  
  163.      If a backslash is used to escape a newline character (\\\\nnnneeeewwwwlllliiiinnnneeee), both the
  164.      backslash and the newline are removed (see the later section on
  165.      "Quoting").  In addition, backslashes used to escape dollar signs (\\\\$$$$)
  166.      are removed.  Since no interpretation is done on the command string
  167.      before it is read, inserting a backslash to escape a dollar sign has no
  168.      effect.  Backslashes that precede characters other than \\\\, ````, """", nnnneeeewwwwlllliiiinnnneeee,
  169.      and $$$$ are left intact when the command string is read.
  170.  
  171.    PPPPaaaarrrraaaammmmeeeetttteeeerrrr SSSSuuuubbbbssssttttiiiittttuuuuttttiiiioooonnnn
  172.      The character $$$$ is used to introduce substitutable _p_a_r_a_m_e_t_e_r_s.  There are
  173.      two types of parameters, positional and keyword.  If _p_a_r_a_m_e_t_e_r is a
  174.      digit, it is a positional parameter.  Positional parameters can be
  175.      assigned values by sssseeeetttt.  Keyword parameters (also known as variables) can
  176.      be assigned values by writing:
  177.  
  178.           _n_a_m_e ==== _v_a_l_u_e [ _n_a_m_e ==== _v_a_l_u_e ] ...
  179.  
  180.      Pattern-matching is not performed on _v_a_l_u_e.  There cannot be a function
  181.      and a variable with the same _n_a_m_e.
  182.  
  183.      $$$${{{{_p_a_r_a_m_e_t_e_r}}}}        The value, if any, of the parameter is substituted.
  184.                          The braces are required only when _p_a_r_a_m_e_t_e_r is
  185.                          followed by a letter, digit, or underscore that is
  186.                          not to be interpreted as part of its name.  If
  187.                          _p_a_r_a_m_e_t_e_r is **** or @@@@, all the positional parameters,
  188.                          starting with $$$$1111, are substituted (separated by
  189.                          spaces).  Parameter $$$$0000 is set from argument zero when
  190.                          the shell is invoked.
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. bbbbsssshhhh((((1111))))                                                                  bbbbsssshhhh((((1111))))
  203.  
  204.  
  205.  
  206.      $$$${{{{_p_a_r_a_m_e_t_e_r::::----_w_o_r_d}}}}  If _p_a_r_a_m_e_t_e_r is set and is non-null, substitute its
  207.                          value; otherwise substitute _w_o_r_d.
  208.  
  209.      $$$${{{{_p_a_r_a_m_e_t_e_r::::====_w_o_r_d}}}}  If _p_a_r_a_m_e_t_e_r is not set or is null set it to _w_o_r_d;
  210.                          the value of the parameter is substituted.
  211.                          Positional parameters cannot be assigned to in this
  212.                          way.
  213.  
  214.      $$$${{{{_p_a_r_a_m_e_t_e_r::::????_w_o_r_d}}}}  If _p_a_r_a_m_e_t_e_r is set and is non-null, substitute its
  215.                          value; otherwise, print _w_o_r_d and exit from the shell.
  216.                          If _w_o_r_d is omitted, the message "parameter null or
  217.                          not set" is printed.
  218.  
  219.      $$$${{{{_p_a_r_a_m_e_t_e_r::::++++_w_o_r_d}}}}  If _p_a_r_a_m_e_t_e_r is set and is non-null, substitute _w_o_r_d;
  220.                          otherwise substitute nothing.
  221.  
  222.      In the above, _w_o_r_d is not evaluated unless it is to be used as the
  223.      substituted string, so that, in the following example, ppppwwwwdddd is executed
  224.      only if dddd is not set or is null:
  225.  
  226.           _eeee_cccc_hhhh_oooo _$$$$_{{{{_dddd_::::_----_````_pppp_wwww_dddd_````_}}}}
  227.  
  228.      If the colon (::::) is omitted from the above expressions, the shell only
  229.      checks whether _p_a_r_a_m_e_t_e_r is set or not.
  230.  
  231.      The following parameters are automatically set by the shell:
  232.  
  233.      ****    Expands to the positional parameters, beginning with _1111.
  234.  
  235.      @@@@    Expands to the positional parameters beginning with _1111, except when
  236.           expanded within double quotes, in which case each positional
  237.           parameter expands as a separate field.
  238.  
  239.      ####    The number of positional parameters in decimal.
  240.  
  241.      ----    Flags supplied to the shell on invocation or by the sssseeeetttt command.
  242.  
  243.      ????    The decimal value returned by the last synchronously executed
  244.           command.
  245.  
  246.      $$$$    The process number of this shell.  _$$$$ reports the process ID of the
  247.           parent shell in all shell constructs, including pipelines, and in
  248.           parenthesized subshells.
  249.  
  250.      !!!!    The process number of the last background command invoked.
  251.  
  252.      The following parameters are used by the shell:
  253.  
  254.      HHHHOOOOMMMMEEEE      The default argument (home directory) for the _cccc_dddd command, set
  255.                to the user's login directory by _llll_oooo_gggg_iiii_nnnn(1) from the password
  256.                file (see _pppp_aaaa_ssss_ssss_wwww_dddd(4)).
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. bbbbsssshhhh((((1111))))                                                                  bbbbsssshhhh((((1111))))
  269.  
  270.  
  271.  
  272.      PPPPAAAATTTTHHHH      The search path for commands (see EEEExxxxeeeeccccuuuuttttiiiioooonnnn below).  The user
  273.                cannot change PPPPAAAATTTTHHHH if executing under _r_s_h.
  274.  
  275.      CCCCDDDDPPPPAAAATTTTHHHH    The search path for the _c_d command.
  276.  
  277.      MMMMAAAAIIIILLLL      If this parameter is set to the name of a mail file _a_n_d the
  278.                MMMMAAAAIIIILLLLPPPPAAAATTTTHHHH parameter is not set, the shell informs the user of
  279.                the arrival of mail in the specified file.
  280.  
  281.      MMMMAAAAIIIILLLLCCCCHHHHEEEECCCCKKKK This parameter specifies how often (in seconds) the shell
  282.                checks for the arrival of mail in the files specified by the
  283.                MMMMAAAAIIIILLLLPPPPAAAATTTTHHHH or MMMMAAAAIIIILLLL parameters.  The default value is 600 seconds
  284.                (10 minutes).  If set to 0, the shell checks before each
  285.                prompt.
  286.  
  287.      MMMMAAAAIIIILLLLPPPPAAAATTTTHHHH  A colon (::::)  separated list of filenames.  If this parameter is
  288.                set, the shell informs the user of the arrival of mail in any
  289.                of the specified files.  Each filename can be followed by %%%% and
  290.                a message to be printed when the modification time changes.
  291.                The default message is "you have mail".
  292.  
  293.      PPPPSSSS1111       Primary prompt string, by default ``$$$$ ''.
  294.  
  295.      PPPPSSSS2222       Secondary prompt string, by default ``>>>> ''.
  296.  
  297.      IIIIFFFFSSSS       Internal field separators, normally ssssppppaaaacccceeee, ttttaaaabbbb, and nnnneeeewwwwlllliiiinnnneeee.
  298.  
  299.      SSSSHHHHAAAACCCCCCCCTTTT    If this parameter is set to the name of a file writable by the
  300.                user, the shell writes an accounting record in the file for
  301.                each shell procedure executed.
  302.  
  303.      SSSSHHHHEEEELLLLLLLL     When the shell is invoked, it scans the environment (see
  304.                EEEEnnnnvvvviiiirrrroooonnnnmmmmeeeennnntttt below) for this name.  If it is found and 'rsh' is
  305.                the filename part of its value, the shell becomes a restricted
  306.                shell.
  307.  
  308.      The shell gives default values to PPPPAAAATTTTHHHH, PPPPSSSS1111, PPPPSSSS2222, MMMMAAAAIIIILLLLCCCCHHHHEEEECCCCKKKK, and IIIIFFFFSSSS.
  309.      HHHHOOOOMMMMEEEE and MMMMAAAAIIIILLLL are set by _l_o_g_i_n(1).
  310.  
  311.    BBBBllllaaaannnnkkkk IIIInnnntttteeeerrrrpppprrrreeeettttaaaattttiiiioooonnnn
  312.      After parameter and command substitution, the results of substitution are
  313.      scanned for internal field separator characters (those found in IIIIFFFFSSSS) and
  314.      split into distinct arguments where such characters are found.  Explicit
  315.      null arguments ("""""""" or '''''''') are retained.  Implicit null arguments (those
  316.      resulting from _p_a_r_a_m_e_t_e_r_s that have no values) are removed.  The original
  317.      whitespace characters (space, tab, and newline) are always considered
  318.      internal field separators.
  319.  
  320.    IIIInnnnppppuuuutttt////OOOOuuuuttttppppuuuutttt
  321.      A command's input and output can be redirected using a special notation
  322.      interpreted by the shell.  The following can appear anywhere in a
  323.      _s_i_m_p_l_e-_c_o_m_m_a_n_d or can precede or follow a _c_o_m_m_a_n_d and are _n_o_t passed on
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. bbbbsssshhhh((((1111))))                                                                  bbbbsssshhhh((((1111))))
  335.  
  336.  
  337.  
  338.      as arguments to the invoked command.  Note that parameter and command
  339.      substitution occurs before _w_o_r_d or _d_i_g_i_t is used.
  340.  
  341.      <<<<wwwwoooorrrrdddd     Use file _w_o_r_d as standard input (file descriptor 0).
  342.  
  343.      >>>>wwwwoooorrrrdddd     Use file _w_o_r_d as standard output (file descriptor 1).  If the
  344.                file does not exist it is created; otherwise, it is truncated
  345.                to zero length.
  346.  
  347.      >>>>>>>>wwwwoooorrrrdddd    Use file _w_o_r_d as standard output.  If the file exists output is
  348.                appended to it (by first seeking to the end-of-file);
  349.                otherwise, the file is created.
  350.  
  351.      <<<<<<<<[----]wwwwoooorrrrdddd After parameter and command substitution is done on _w_o_r_d, the
  352.                shell input is read up to the first line that literally matches
  353.                the resulting _w_o_r_d, or to an end-of-file.  If, however, ---- is
  354.                appended to <<<<<<<<:
  355.  
  356.                1.  Leading tabs are stripped from _w_o_r_d before the shell input
  357.                    is read (but after parameter and command substitution is
  358.                    done on _w_o_r_d).
  359.  
  360.                2.  Leading tabs are stripped from the shell input as it is
  361.                    read and before each line is compared with _w_o_r_d.
  362.  
  363.                3.  Shell input is read up to the first line that literally
  364.                    matches the resulting _w_o_r_d, or to an end-of-file.
  365.  
  366.                If any character of _w_o_r_d is quoted (see QQQQuuuuoooottttiiiinnnngggg, later), no
  367.                additional processing is done to the shell input.  If no
  368.                characters of _w_o_r_d are quoted:
  369.  
  370.                1.  Parameter and command substitution occurs.
  371.  
  372.                2.  (Escaped) \\\\nnnneeeewwwwlllliiiinnnneeee is ignored.
  373.  
  374.                3.  \\\\ must be used to quote the characters \\\\, $$$$, and ````.
  375.  
  376.                The resulting document becomes the standard input.
  377.  
  378.      <<<<&&&&_d_i_g_i_t   Use the file associated with file descriptor _d_i_g_i_t as standard
  379.                input.  Similarly for the standard output using >>>>&&&&_d_i_g_i_t.
  380.  
  381.      <<<<&&&&----       The standard input is closed.  Similarly for the standard
  382.                output using >>>>&&&&----.
  383.  
  384.      If any of the above is preceded by a digit, the file descriptor that will
  385.      be associated with the file is that specified by the digit (instead of
  386.      the default 0 or 1).  For example:
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. bbbbsssshhhh((((1111))))                                                                  bbbbsssshhhh((((1111))))
  401.  
  402.  
  403.  
  404.           _...._...._.... _2222_>>>>_&&&&_1111
  405.  
  406.      associates file descriptor 2 with the file currently associated with file
  407.      descriptor 1.
  408.  
  409.      The order in which redirections are specified is significant.  The shell
  410.      evaluates redirections left-to-right.  For example:
  411.  
  412.           _...._...._.... _1111_>>>>_x_x_x _2222_>>>>_&&&&_1111
  413.  
  414.      first associates file descriptor 1 with file _x_x_x.  It associates file
  415.      descriptor 2 with the file associated with file descriptor 1 (that is,
  416.      _x_x_x).  If the order of redirections were reversed, file descriptor 2
  417.      would be associated with the terminal (assuming file descriptor 1 had
  418.      been) and file descriptor 1 would be associated with file _x_x_x.
  419.  
  420.      Using the terminology introduced on the first page, under CCCCoooommmmmmmmaaaannnnddddssss, if a
  421.      _c_o_m_m_a_n_d is composed of several _s_i_m_p_l_e _c_o_m_m_a_n_d_s, redirection is evaluated
  422.      for the entire _c_o_m_m_a_n_d before it is evaluated for each _s_i_m_p_l_e _c_o_m_m_a_n_d.
  423.      That is, the shell evaluates redirection for the entire _l_i_s_t, then each
  424.      _p_i_p_e_l_i_n_e within the _l_i_s_t, then each _c_o_m_m_a_n_d within each _p_i_p_e_l_i_n_e, then
  425.      each _l_i_s_t within each _c_o_m_m_a_n_d.
  426.  
  427.      If a command is followed by &&&& the default standard input for the command
  428.      is the empty file /_d_e_v/_n_u_l_l.  Otherwise, the environment for the
  429.      execution of a command contains the file descriptors of the invoking
  430.      shell as modified by input/output specifications.
  431.  
  432.      Redirection of output is not allowed in the restricted shell.
  433.  
  434.    FFFFiiiilllleeeennnnaaaammmmeeee GGGGeeeennnneeeerrrraaaattttiiiioooonnnn
  435.      Before a command is executed, each command _w_o_r_d is scanned for the
  436.      characters ****, ????, and [[[[.  If one of these characters appears the word is
  437.      regarded as a _p_a_t_t_e_r_n.  The word is replaced with alphabetically sorted
  438.      filenames that match the pattern.  If no filename is found that matches
  439.      the pattern, the word is left unchanged.  The character .... at the start of
  440.      a filename or immediately following a ////, as well as the character ////
  441.      itself, must be matched explicitly.
  442.  
  443.      ****    Matches any string, including the null string.
  444.  
  445.      ????    Matches any single character.
  446.  
  447.      [[[[...]]]]
  448.           Matches any one of the enclosed characters.  A pair of characters
  449.           separated by ---- matches any character lexically between the pair,
  450.           inclusive.  If the first character following the opening [[[[ is a !!!!,
  451.           any character not enclosed is matched.
  452.  
  453.    QQQQuuuuoooottttiiiinnnngggg
  454.      The following characters have a special meaning to the shell and cause
  455.      termination of a word unless quoted:
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. bbbbsssshhhh((((1111))))                                                                  bbbbsssshhhh((((1111))))
  467.  
  468.  
  469.  
  470.           ;;;;  &&&&  ((((  ))))  ||||  ^^^^  <<<<  >>>>  nnnneeeewwwwlllliiiinnnneeee  ssssppppaaaacccceeee  ttttaaaabbbb
  471.  
  472.      A character can be _q_u_o_t_e_d that is, made to stand for itself) by preceding
  473.      it with a backslash (\\\\) or inserting it between a pair of quote marks (''''''''
  474.      or """""""").  During processing, the shell can quote certain characters to
  475.      prevent them from taking on a special meaning.  Backslashes used to quote
  476.      a single character are removed from the word before the command is
  477.      executed.  The pair \\\\nnnneeeewwwwlllliiiinnnneeee is removed from a word before command and
  478.      parameter substitution.
  479.  
  480.      All characters enclosed between a pair of single quote marks (''''''''), except
  481.      a single quote, are quoted by the shell.  Backslash has no special
  482.      meaning inside a pair of single quotes.  A single quote can be quoted
  483.      inside a pair of double quote marks (for example, """"''''"""").
  484.  
  485.      Inside a pair of double quote marks (""""""""), parameter and command
  486.      substitution occurs and the shell quotes the results to avoid blank
  487.      interpretation and filename generation.  If $$$$**** is within a pair of double
  488.      quotes, the positional parameters are substituted and quoted, separated
  489.      by quoted spaces (""""$$$$1111 $$$$2222 ...""""); however, if $$$$@@@@ is within a pair of double
  490.      quotes, the positional parameters are substituted and quoted, separated
  491.      by unquoted spaces (""""$$$$1111"""" """"$$$$2222"""" ...).  \\\\ quotes the characters \\\\, ````, """", and
  492.      $$$$.  The pair \\\\nnnneeeewwwwlllliiiinnnneeee is removed before parameter and command
  493.      substitution.  If a backslash precedes characters other than \\\\, ````, """", $$$$,
  494.      and newline, then the backslash itself is quoted by the shell.
  495.  
  496.    PPPPrrrroooommmmppppttttiiiinnnngggg
  497.      When used interactively, the shell prompts with the value of PPPPSSSS1111 before
  498.      reading a command.  If at any time a newline is typed and further input
  499.      is needed to complete a command, the secondary prompt that is, the value
  500.      of PPPPSSSS2222) is issued.
  501.  
  502.    EEEEnnnnvvvviiiirrrroooonnnnmmmmeeeennnntttt
  503.      The _e_n_v_i_r_o_n_m_e_n_t (see _e_n_v_i_r_o_n(5)) is a list of name-value pairs that is
  504.      passed to an executed program in the same way as a normal argument list.
  505.      The shell interacts with the environment in several ways.  On invocation,
  506.      the shell scans the environment and creates a parameter for each name
  507.      found, giving it the corresponding value.  If the user modifies the value
  508.      of any of these parameters or creates new parameters, none of these
  509.      affects the environment unless the eeeexxxxppppoooorrrrtttt command is used to bind the
  510.      shell's parameter to the environment (see also sssseeeetttt ----aaaa).  A parameter can
  511.      be removed from the environment with the uuuunnnnsssseeeetttt command.  The environment
  512.      seen by any executed command is thus composed of any unmodified name-
  513.      value pairs originally inherited by the shell, minus any pairs removed by
  514.      uuuunnnnsssseeeetttt, plus any modifications or additions, all of which must be noted in
  515.      eeeexxxxppppoooorrrrtttt commands.
  516.  
  517.      The environment for any _s_i_m_p_l_e-_c_o_m_m_a_n_d can be augmented by prefixing it
  518.      with one or more assignments to parameters.  Thus these two commands are
  519.      equivalent (as far as the execution of _c_m_d is concerned if _c_m_d is not a
  520.      Special Command):
  521.  
  522.  
  523.  
  524.  
  525.                                                                         PPPPaaaaggggeeee 8888
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. bbbbsssshhhh((((1111))))                                                                  bbbbsssshhhh((((1111))))
  533.  
  534.  
  535.  
  536.           _TTTT_EEEE_RRRR_MMMM_====_4444_5555_0000 _cccc_mmmm_dddd
  537.           _((((_eeee_xxxx_pppp_oooo_rrrr_tttt _TTTT_EEEE_RRRR_MMMM_;;;; _TTTT_EEEE_RRRR_MMMM_====_4444_5555_0000_;;;; _cccc_mmmm_dddd_))))
  538.  
  539.      If _c_m_d is a Special Command, then
  540.  
  541.           _TTTT_EEEE_RRRR_MMMM_====_4444_5555 _cccc_mmmm_dddd
  542.  
  543.      modifies the _TTTT_EEEE_RRRR_MMMM variable in the current shell.
  544.  
  545.      If the ----kkkk flag is set, _a_l_l keyword arguments are placed in the
  546.      environment, even if they occur after the command name.  The following
  547.      first prints aaaa====bbbb cccc and cccc:
  548.  
  549.           _eeee_cccc_hhhh_oooo _aaaa_====_bbbb _cccc
  550.           _ssss_eeee_tttt _----_kkkk
  551.           _eeee_cccc_hhhh_oooo _aaaa_====_bbbb _cccc
  552.  
  553.  
  554.    SSSSiiiiggggnnnnaaaallllssss
  555.      When a command is run in the background (_c_m_d _&&&&) under _ssss_hhhh, it can receive
  556.      INTERRUPT and QUIT signals but ignores them by default.  (A background
  557.      process can override this default behavior via trap or signal.  For
  558.      details, see the description of _tttt_rrrr_aaaa_pppp, below, or _ssss_iiii_gggg_nnnn_aaaa_llll(2).)  When a
  559.      command is run in the background under _jjjj_ssss_hhhh, however, it does not receive
  560.      INTERRUPT or QUIT signals.
  561.  
  562.      Otherwise signals have the values inherited by the shell from its parent,
  563.      with the exception of signal 11 (SIGSEGV).  See also the _tttt_rrrr_aaaa_pppp command
  564.      below.
  565.  
  566.    EEEExxxxeeeeccccuuuuttttiiiioooonnnn
  567.      Each time a command is executed, the command substitution, parameter
  568.      substitution, blank interpretation, input/output redirection, and
  569.      filename generation listed above are carried out.  If the command name
  570.      matches the name of a defined function, the function is executed in the
  571.      shell process (note how this differs from the execution of shell
  572.      procedures).  If the command name does not match the name of a defined
  573.      function, but matches one of the SSSSppppeeeecccciiiiaaaallll CCCCoooommmmmmmmaaaannnnddddssss listed below, it is
  574.      executed in the shell process.  The positional parameters $$$$1111, $$$$2222, and so
  575.      on are set to the arguments of the function.  If the command name matches
  576.      neither a Special Command nor the name of a defined function, a new
  577.      process is created and an attempt is made to execute the command via
  578.      _e_x_e_c(2).
  579.  
  580.      The shell parameter PPPPAAAATTTTHHHH defines the search path for the directory
  581.      containing the command.  Alternative directory names are separated by a
  582.      colon (::::).  The default path is:
  583.  
  584.           ::::////uuuussssrrrr////ssssbbbbiiiinnnn::::////uuuussssrrrr////bbbbssssdddd::::////bbbbiiiinnnn::::////uuuussssrrrr////bbbbiiiinnnn::::////uuuussssrrrr////bbbbiiiinnnn////XXXX11111111
  585.  
  586.      specifying the current directory, /_u_s_r/_s_b_i_n, /_u_s_r/_b_s_d, /_b_i_n, /_u_s_r/_b_i_n,
  587.      and /_u_s_r/_b_i_n/_X_1_1, in that order.  Note that the current directory is
  588.  
  589.  
  590.  
  591.                                                                         PPPPaaaaggggeeee 9999
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598. bbbbsssshhhh((((1111))))                                                                  bbbbsssshhhh((((1111))))
  599.  
  600.  
  601.  
  602.      specified by a null pathname.  It can appear immediately after the equal
  603.      sign, between two colon delimiters anywhere in the path list, or at the
  604.      end of the path list.  If the command name contains a //// the search path
  605.      is not used; such commands are not executed by the restricted shell.
  606.      Otherwise, each directory in the path is searched for an executable file.
  607.      If the file has execute permission but is not an aaaa....oooouuuutttt file, it is
  608.      assumed to be a file containing shell commands.  A subshell is spawned to
  609.      read it.  A parenthesized command is also executed in a subshell.
  610.  
  611.      The location in the search path where a command was found is remembered
  612.      by the shell (to help avoid unnecessary _e_x_e_c_s later).  If the command was
  613.      found in a relative directory, its location must be re-determined
  614.      whenever the current directory changes.  The shell forgets all remembered
  615.      locations whenever the PPPPAAAATTTTHHHH variable is changed or the hhhhaaaasssshhhh ----rrrr command is
  616.      executed (see below).
  617.  
  618.    SSSSppppeeeecccciiiiaaaallll CCCCoooommmmmmmmaaaannnnddddssss
  619.      Input/output redirection is now permitted for these commands.  File
  620.      descriptor 1 is the default output location.  When Job Control is
  621.      enabled, additional Special Commands are added to the shell's environment
  622.      (see JJJJoooobbbb CCCCoooonnnnttttrrrroooollll).
  623.  
  624.      ::::                   No effect; the command does nothing.  A zero exit
  625.                          code is returned.
  626.  
  627.      .... _f_i_l_e              Read and execute commands from _f_i_l_e and return.  The
  628.                          search path specified by PPPPAAAATTTTHHHH is used to find the
  629.                          directory containing _f_i_l_e.
  630.  
  631.      bbbbrrrreeeeaaaakkkk [ _n ]         Exit from the enclosing ffffoooorrrr or wwwwhhhhiiiilllleeee loop, if any.
  632.                          If _n is specified break _n levels.
  633.  
  634.      ccccoooonnnnttttiiiinnnnuuuueeee [ _n ]      Resume the next iteration of the enclosing ffffoooorrrr or
  635.                          wwwwhhhhiiiilllleeee loop.  If _n is specified resume at the _n-th
  636.                          enclosing loop.
  637.  
  638.      ccccdddd [ _a_r_g ]          Change the current directory to _a_r_g.  The shell
  639.                          parameter HHHHOOOOMMMMEEEE is the default _a_r_g.  The shell
  640.                          parameter CCCCDDDDPPPPAAAATTTTHHHH defines the search path for the
  641.                          directory containing _a_r_g.  Alternative directory
  642.                          names are separated by a colon (::::).  The default path
  643.                          is <<<<nnnnuuuullllllll>>>> (specifying the current directory).  Note
  644.                          that the current directory is specified by a null
  645.                          pathname.  It can appear immediately after the equal
  646.                          sign or between the colon delimiters anywhere else in
  647.                          the path list.  If _a_r_g begins with a //// the search
  648.                          path is not used.  Otherwise, each directory in the
  649.                          path is searched for _a_r_g.  The _c_d command cannot be
  650.                          executed by _r_s_h.
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.                                                                        PPPPaaaaggggeeee 11110000
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664. bbbbsssshhhh((((1111))))                                                                  bbbbsssshhhh((((1111))))
  665.  
  666.  
  667.  
  668.      eeeecccchhhhoooo [ _a_r_g ... ]    Echo arguments.  See _e_c_h_o(1) for usage and
  669.                          description.
  670.  
  671.      eeeevvvvaaaallll [ _a_r_g ... ]    The arguments are read as input to the shell and the
  672.                          resulting command(s) executed.
  673.  
  674.      eeeexxxxeeeecccc [ _a_r_g ... ]    The command specified by the arguments is executed in
  675.                          place of this shell without creating a new process.
  676.                          Input/output arguments can appear and, if no other
  677.                          arguments are given, cause the shell input/output to
  678.                          be modified.
  679.  
  680.      eeeexxxxiiiitttt [ _n ]          Causes a shell to exit with the exit status specified
  681.                          by _n.  If _n is omitted, the exit status is that of
  682.                          the last command executed (an end-of-file also causes
  683.                          the shell to exit.)
  684.  
  685.      eeeexxxxppppoooorrrrtttt [ _n_a_m_e ... ] The given _n_a_m_es are marked for automatic export to
  686.                          the _e_n_v_i_r_o_n_m_e_n_t of subsequently-executed commands.
  687.                          If no arguments are given, variable names that have
  688.                          been marked for export during the current shell's
  689.                          execution are listed.  (Variable names exported from
  690.                          a parent shell are listed only if they have been
  691.                          exported again during the current shell's execution.)
  692.                          Function names are _n_o_t exported.
  693.  
  694.      ggggeeeettttooooppppttttssss             Use in shell scripts to support command syntax
  695.                          standards (see _i_n_t_r_o(1)); it parses positional
  696.                          parameters and checks for legal options.  See
  697.                          _g_e_t_o_p_t_s(1) for usage and description.
  698.  
  699.      hhhhaaaasssshhhh [ ----rrrr ] [ _n_a_m_e ... ]
  700.                          For each _n_a_m_e, the location in the search path of the
  701.                          command specified by _n_a_m_e is determined and
  702.                          remembered by the shell.  The ----rrrr option causes the
  703.                          shell to forget all remembered locations.  If no
  704.                          arguments are given, information about remembered
  705.                          commands is presented.  _h_i_t_s is the number of times a
  706.                          command has been invoked by the shell process.  _c_o_s_t
  707.                          is a measure of the work required to locate a command
  708.                          in the search path.  If a command is found in a
  709.                          "relative" directory in the search path, after
  710.                          changing to that directory, the stored location of
  711.                          that command is recalculated.  Commands for which
  712.                          this is done are indicated by an asterisk (****)
  713.                          adjacent to the _h_i_t_s information.  _c_o_s_t is
  714.                          incremented when the recalculation is done.
  715.  
  716.      lllliiiimmmmiiiitttt [ ----hhhh ] [ _r_e_s_o_u_r_c_e [_m_a_x_i_m_u_m-_u_s_e ] ]
  717.                          Limits the consumption by the current process and
  718.                          each process it creates to not individually exceed
  719.                          _m_a_x_i_m_u_m-_u_s_e on the specified _r_e_s_o_u_r_c_e.  If no
  720.  
  721.  
  722.  
  723.                                                                        PPPPaaaaggggeeee 11111111
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. bbbbsssshhhh((((1111))))                                                                  bbbbsssshhhh((((1111))))
  731.  
  732.  
  733.  
  734.                          _m_a_x_i_m_u_m-_u_s_e is given, then the current limit is
  735.                          printed; if no _r_e_s_o_u_r_c_e is given, then all
  736.                          limitations are given.  If the ----hhhh flag is given, the
  737.                          hard limits are used instead of the current limits.
  738.                          The hard limits impose a ceiling on the values of the
  739.                          current limits.  Only the superuser can raise the
  740.                          hard limits, but a user can lower or raise the
  741.                          current limits within the legal range.
  742.  
  743.                          Resources controllable currently include _c_p_u_t_i_m_e, the
  744.                          maximum number of cpu-seconds to be used by each
  745.                          process, _f_i_l_e_s_i_z_e, the largest single file that can
  746.                          be created, _d_a_t_a_s_i_z_e, the maximum growth of the data
  747.                          region via _s_b_r_k(2) beyond the end of the program
  748.                          text, _s_t_a_c_k_s_i_z_e, the maximum size of the
  749.                          automatically-extended stack region, _c_o_r_e_d_u_m_p_s_i_z_e,
  750.                          the size of the largest core dump created, _m_e_m_o_r_y_u_s_e,
  751.                          the maximum amount of physical memory a process can
  752.                          have allocated to it at a given time, _d_e_s_c_r_i_p_t_o_r_s,
  753.                          the maximum number of open files, and _v_m_e_m_o_r_y, the
  754.                          maximum total virtual size of the process, including
  755.                          text, data, heap, shared memory, mapped files, stack,
  756.                          and so on.
  757.  
  758.                          The _m_a_x_i_m_u_m-_u_s_e can be given as a (floating point or
  759.                          integer) number followed by a scale factor.  For all
  760.                          limits other than _c_p_u_t_i_m_e the default scale is kkkk or
  761.                          kkkkiiiilllloooobbbbyyyytttteeeessss (1024 bytes); a scale factor of mmmm or
  762.                          mmmmeeeeggggaaaabbbbyyyytttteeeessss can also be used.  For _c_p_u_t_i_m_e the default
  763.                          scaling is sssseeeeccccoooonnnnddddssss, while mmmm for minutes or hhhh for
  764.                          hours, or a time of the form _m_m::::_s_s giving minutes and
  765.                          seconds can be used.
  766.  
  767.                          For both _r_e_s_o_u_r_c_e names and scale factors,
  768.                          unambiguous prefixes of the names suffice.
  769.  
  770.      nnnneeeewwwwggggrrrrpppp [ _a_r_g ... ]  Equivalent to eeeexxxxeeeecccc nnnneeeewwwwggggrrrrpppp _a_r_g ....  See _n_e_w_g_r_p(1) for
  771.                          usage and description.
  772.  
  773.      ppppwwwwdddd                 Print the current working directory.  See _p_w_d(1) for
  774.                          usage and description.
  775.  
  776.      rrrreeeeaaaadddd [ _n_a_m_e ... ]   One line is read from the standard input and, using
  777.                          the internal field separator, IIIIFFFFSSSS (normally space or
  778.                          tab), to delimit word boundaries, the first word is
  779.                          assigned to the first _n_a_m_e, the second word to the
  780.                          second _n_a_m_e, and so on, with leftover words assigned
  781.                          to the last _n_a_m_e.  Lines can be continued using
  782.                          \\\\nnnneeeewwwwlllliiiinnnneeee.  Characters other than nnnneeeewwwwlllliiiinnnneeee can be
  783.                          quoted by preceding them with a backslash.  These
  784.                          backslashes are removed before words are assigned to
  785.                          _n_a_m_e_s, and no interpretation is done on the character
  786.  
  787.  
  788.  
  789.                                                                        PPPPaaaaggggeeee 11112222
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796. bbbbsssshhhh((((1111))))                                                                  bbbbsssshhhh((((1111))))
  797.  
  798.  
  799.  
  800.                          that follows the backslash.  The return code is 0
  801.                          unless an end-of-file is encountered.
  802.  
  803.      rrrreeeeaaaaddddoooonnnnllllyyyy [ _n_a_m_e ... ]
  804.                          The given _n_a_m_es are marked rrrreeeeaaaaddddoooonnnnllllyyyy and the values of
  805.                          the these _n_a_m_es cannot be changed by subsequent
  806.                          assignment.  If no arguments are given, a list of all
  807.                          rrrreeeeaaaaddddoooonnnnllllyyyy names is printed.
  808.  
  809.      rrrreeeettttuuuurrrrnnnn [ _n ]        Causes a function to exit with the return value
  810.                          specified by _n.  If _n is omitted, the return status
  811.                          is that of the last command executed.
  812.  
  813.      sssseeeetttt [ --------aaaaeeeeffffhhhhkkkknnnnttttuuuuvvvvxxxx [ _a_r_g ... ] ]
  814.  
  815.                          ----aaaa   Mark variables that are modified or created for
  816.                               export.
  817.  
  818.                          ----eeee   Exit immediately if a command exits with a
  819.                               nonzero exit status.
  820.  
  821.                          ----ffff   Disable filename generation.
  822.  
  823.                          ----hhhh   Locate and remember function commands as
  824.                               functions are defined (function commands are
  825.                               normally located when the function is executed).
  826.  
  827.                          ----kkkk   All keyword arguments are placed in the
  828.                               environment for a command, not just those that
  829.                               precede the command name.
  830.  
  831.                          ----nnnn   Read commands but do not execute them.
  832.  
  833.                          ----tttt   Exit after reading and executing one command.
  834.  
  835.                          ----uuuu   Treat unset variables as an error when
  836.                               substituting.
  837.  
  838.                          ----vvvv   Print shell input lines as they are read.
  839.  
  840.                          ----xxxx   Print commands and their arguments as they are
  841.                               executed.
  842.  
  843.                          --------   Do not change any of the flags; useful in
  844.                               setting $$$$1111 to ----.
  845.  
  846.                          Using ++++ rather than ---- causes these flags to be turned
  847.                          off.  These flags can also be used upon invocation of
  848.                          the shell.  The current set of flags can be found in
  849.                          $$$$----.  The remaining arguments are positional
  850.                          parameters and are assigned, in order, to $$$$1111, $$$$2222,
  851.                          ....  If no arguments are given the values of all
  852.  
  853.  
  854.  
  855.                                                                        PPPPaaaaggggeeee 11113333
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862. bbbbsssshhhh((((1111))))                                                                  bbbbsssshhhh((((1111))))
  863.  
  864.  
  865.  
  866.                          names are printed.
  867.  
  868.      sssshhhhiiiifffftttt [ _n ]         The positional parameters from $$$$nnnn++++1111 ...  are renamed
  869.                          $$$$1111 ....  If _n is not given, it is assumed to be 1.
  870.  
  871.      tttteeeesssstttt                Evaluate conditional expressions.  See _t_e_s_t(1) for
  872.                          usage and description.
  873.  
  874.      ttttiiiimmmmeeeessss               Print the accumulated user and system times for
  875.                          processes run from the shell.
  876.  
  877.      ttttrrrraaaapppp [ _a_r_g ] [ _n ] ...
  878.                          The command _a_r_g is to be read and executed when the
  879.                          shell receives signal(s) _n.  (Note that _a_r_g is
  880.                          scanned once when the trap is set and once when the
  881.                          trap is taken.)  Trap commands are executed in order
  882.                          of signal number.  Any attempt to set a trap on a
  883.                          signal that was ignored on entry to the current shell
  884.                          is ineffective.  An error results when an attempt is
  885.                          made to trap signal 11 (SIGSEGV--segmentation fault).
  886.                          If _a_r_g is absent all trap(s) _n are reset to their
  887.                          original values.  If _a_r_g is the null string this
  888.                          signal is ignored by the shell and by the commands it
  889.                          invokes.  If _n is 0 the command _a_r_g is executed on
  890.                          exit from the shell.  The ttttrrrraaaapppp command with no
  891.                          arguments prints a list of commands associated with
  892.                          each signal number.
  893.  
  894.      ttttyyyyppppeeee [ _n_a_m_e ... ]   For each _n_a_m_e, indicate how it would be interpreted
  895.                          if used as a command name.
  896.  
  897.      uuuulllliiiimmmmiiiitttt [ _n ]        Impose a size limit of _n blocks on files written by
  898.                          the shell and its child processes (files of any size
  899.                          can be read).  If _n is omitted, the current limit is
  900.                          printed.  You can lower your own ulimit, but only a
  901.                          superuser (see _s_u(1M)) can raise a ulimit.
  902.  
  903.      uuuummmmaaaasssskkkk [ _n_n_n ]       The user file creation mask is set to _n_n_n (see
  904.                          _u_m_a_s_k(1)).  If _n_n_n is omitted, the current value of
  905.                          the mask is printed.
  906.  
  907.      uuuunnnnlllliiiimmmmiiiitttt [ ----hhhh ] [ _r_e_s_o_u_r_c_e ]
  908.                          Removes the limitation on _r_e_s_o_u_r_c_e.  If no _r_e_s_o_u_r_c_e
  909.                          is specified, then all _r_e_s_o_u_r_c_e limitations are
  910.                          removed.  If ----hhhh is given, the corresponding hard
  911.                          limits are removed.  Only the superuser can do this.
  912.  
  913.      uuuunnnnsssseeeetttt [ _n_a_m_e ... ]  For each _n_a_m_e, remove the corresponding variable or
  914.                          function.  The variables PPPPAAAATTTTHHHH, PPPPSSSS1111, PPPPSSSS2222, MMMMAAAAIIIILLLLCCCCHHHHEEEECCCCKKKK
  915.                          and IIIIFFFFSSSS cannot be unset.
  916.  
  917.  
  918.  
  919.  
  920.  
  921.                                                                        PPPPaaaaggggeeee 11114444
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928. bbbbsssshhhh((((1111))))                                                                  bbbbsssshhhh((((1111))))
  929.  
  930.  
  931.  
  932.      wwwwaaaaiiiitttt [ _n ]          Wait for your background process whose process id is
  933.                          _n and report its termination status.  If _n is
  934.                          omitted, all your shell's currently active background
  935.                          processes are waited for and the return code is zero.
  936.  
  937.    IIIInnnnvvvvooooccccaaaattttiiiioooonnnn
  938.      If the shell is invoked through _e_x_e_c(2) and the first character of
  939.      argument zero is ----, commands are initially read from /_e_t_c/_p_r_o_f_i_l_e and
  940.      from $_H_O_M_E/._p_r_o_f_i_l_e, if such files exist.  Thereafter, commands are read
  941.      as described below, which is also the case when the shell is invoked as
  942.      /_b_i_n/_s_h.  The flags below are interpreted by the shell on invocation
  943.      only; Note that unless the ----cccc or ----ssss flag is specified, the first argument
  944.      is assumed to be the name of a file containing commands, and the
  945.      remaining arguments are passed as positional parameters to that command
  946.      file:
  947.  
  948.      ----cccc _s_t_r_i_n_g
  949.           If the ----cccc flag is present, commands are read from _s_t_r_i_n_g.
  950.  
  951.      ----ssss   If the ----ssss flag is present or if no arguments remain, commands are
  952.           read from the standard input.  Any remaining arguments specify the
  953.           positional parameters.  Shell output (except for Special Commands)
  954.           is written to file descriptor 2.
  955.  
  956.      ----iiii   If the ----iiii flag is present or if the shell input and output are
  957.           attached to a terminal, this shell is _i_n_t_e_r_a_c_t_i_v_e.  In this case
  958.           TERMINATE is ignored (so that kkkkiiiillllllll 0000 does not kill an interactive
  959.           shell) and INTERRUPT is caught and ignored (so that wwwwaaaaiiiitttt is
  960.           interruptible).  In all cases, QUIT is ignored by the shell.
  961.  
  962.      ----pppp   If the ----pppp flag is present, the shell skips the processing of the
  963.           system profile (_////_eeee_tttt_cccc_////_pppp_rrrr_oooo_ffff_iiii_llll_eeee) and the user profile (_...._pppp_rrrr_oooo_ffff_iiii_llll_eeee) when
  964.           it starts.
  965.  
  966.      ----rrrr   If the ----rrrr flag is present the shell is a restricted shell.
  967.  
  968.      The remaining flags and arguments are described under the _ssss_eeee_tttt command
  969.      above.
  970.  
  971.    JJJJoooobbbb CCCCoooonnnnttttrrrroooollll ((((jjjjsssshhhh))))
  972.      When the shell is invoked as _jjjj_ssss_hhhh, Job Control is enabled in addition to
  973.      all of the functionality described previously for _ssss_hhhh.  Typically Job
  974.      Control is enabled for the interactive shell only.  Noninteractive shells
  975.      typically do not benefit from the added functionality of Job Control.
  976.  
  977.      With Job Control enabled every command or pipeline the user enters at the
  978.      terminal is called a _j_o_b.  All jobs exist in one of the following states:
  979.      foreground, background, or stopped.  These terms are defined as follows:
  980.      1) a job in the foreground has read and write access to the controlling
  981.      terminal; 2) a job in the background is denied read access and has
  982.      conditional write access to the controlling terminal (see _ssss_tttt_tttt_yyyy(1)); 3) a
  983.      stopped job is a job that has been placed in a suspended state, usually
  984.  
  985.  
  986.  
  987.                                                                        PPPPaaaaggggeeee 11115555
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994. bbbbsssshhhh((((1111))))                                                                  bbbbsssshhhh((((1111))))
  995.  
  996.  
  997.  
  998.      as a result of a _SSSS_IIII_GGGG_TTTT_SSSS_TTTT_PPPP signal (see _ssss_iiii_gggg_nnnn_aaaa_llll(2)).  Jobs in the foreground
  999.      can be stopped by INTERRUPT or QUIT signals from the keyboard; background
  1000.      jobs cannot be stopped by these signals.
  1001.  
  1002.      Every job the shell starts is assigned a positive integer, called a _j_o_b
  1003.      _n_u_m_b_e_r, which is tracked by the shell and is used, later, as an
  1004.      identifier to indicate a specific job.  Additionally the shell keeps
  1005.      track of the _c_u_r_r_e_n_t and _p_r_e_v_i_o_u_s jobs.  The _c_u_r_r_e_n_t _j_o_b is the most
  1006.      recent job to be started or restarted.  The _p_r_e_v_i_o_u_s _j_o_b is the first
  1007.      noncurrent job.
  1008.  
  1009.      The acceptable syntax for a Job Identifier is of the form:
  1010.  
  1011.           _%%%%_j_o_b_i_d
  1012.  
  1013.      where _j_o_b_i_d can be specified in any of the following formats:
  1014.  
  1015.      _%%%% or _++++    For the current job.
  1016.  
  1017.      _----         For the previous job.
  1018.  
  1019.      _????_s_t_r_i_n_g   Specify the job for which the command line uniquely contains
  1020.                _s_t_r_i_n_g.
  1021.  
  1022.      _n         For job number _n, where _n is a job number.
  1023.  
  1024.      _p_r_e_f      Where _p_r_e_f is a unique prefix of the command name (for example,
  1025.                if the command _llll_ssss _----_llll _ffff_oooo_oooo were running in the background, it
  1026.                could be referred to as _%%%%_llll_ssss); _p_r_e_f cannot contain blanks unless
  1027.                it is quoted.
  1028.  
  1029.      When Job Control is enabled, the following commands are added to the
  1030.      user's environment to manipulate jobs:
  1031.  
  1032.      _bbbb_gggg [_%%%%_j_o_b_i_d ...]     Resumes the execution of a stopped job in the
  1033.                          background.  If _%%%%_j_o_b_i_d is omitted the current job is
  1034.                          assumed.
  1035.  
  1036.      _ffff_gggg [_%%%%_j_o_b_i_d ...]     Resumes the execution of a stopped job in the
  1037.                          foreground, also moves an executing background job
  1038.                          into the foreground.  If _%%%%_j_o_b_i_d is omitted the
  1039.                          current job is assumed.
  1040.  
  1041.      _jjjj_oooo_bbbb_ssss [_----_pppp_||||_----_llll] [_%%%%_j_o_b_i_d ...]
  1042.  
  1043.      _jjjj_oooo_bbbb_ssss _----_xxxx _c_o_m_m_a_n_d [_a_r_g_u_m_e_n_t_s]
  1044.                          Reports all jobs that are stopped or executing in the
  1045.                          background.  If _%%%%_j_o_b_i_d is omitted, all jobs that are
  1046.                          stopped or running in the background are reported.
  1047.                          The following options modify/enhance the output of
  1048.                          _jjjj_oooo_bbbb_ssss:
  1049.  
  1050.  
  1051.  
  1052.  
  1053.                                                                        PPPPaaaaggggeeee 11116666
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. bbbbsssshhhh((((1111))))                                                                  bbbbsssshhhh((((1111))))
  1061.  
  1062.  
  1063.  
  1064.                          _----_llll   Report the process group ID and working
  1065.                               directory of the jobs.
  1066.  
  1067.                          _----_pppp   Report only the process group ID of the jobs.
  1068.  
  1069.                          _----_xxxx   Replace any _j_o_b_i_d found in _c_o_m_m_a_n_d or _a_r_g_u_m_e_n_t_s
  1070.                               with the corresponding process group ID, and
  1071.                               then execute _c_o_m_m_a_n_d passing it _a_r_g_u_m_e_n_t_s.
  1072.  
  1073.      _kkkk_iiii_llll_llll [-_ssss_iiii_gggg_nnnn_aaaa_llll] _%%%%_j_o_b_i_d
  1074.                          Builtin version of _kkkk_iiii_llll_llll to provide the functionality
  1075.                          of the _kkkk_iiii_llll_llll command for processes identified with a
  1076.                          _j_o_b_i_d.
  1077.  
  1078.      _ssss_tttt_oooo_pppp _%%%%_j_o_b_i_d . . .   Stops the execution of a background job(s).
  1079.  
  1080.      _ssss_uuuu_ssss_pppp_eeee_nnnn_dddd             Stops the execution of the current shell (but not if
  1081.                          it is the login shell).
  1082.  
  1083.      _wwww_aaaa_iiii_tttt [_%%%%_j_o_b_i_d ...]   _wwww_aaaa_iiii_tttt builtin accepts a job identifier.  If _%%%%_j_o_b_i_d is
  1084.                          omitted, _wwww_aaaa_iiii_tttt behaves as described above under
  1085.                          SSSSppppeeeecccciiiiaaaallll CCCCoooommmmmmmmaaaannnnddddssss.
  1086.  
  1087.    RRRReeeessssttttrrrriiiicccctttteeeedddd SSSShhhheeeellllllll ((((////uuuussssrrrr////lllliiiibbbb////rrrrsssshhhh)))) OOOOnnnnllllyyyy
  1088.      _////_uuuu_ssss_rrrr_////_llll_iiii_bbbb_////_rrrr_ssss_hhhh is used to set up login names and execution environments
  1089.      whose capabilities are more controlled than those of the standard shell.
  1090.      The actions of _////_uuuu_ssss_rrrr_////_llll_iiii_bbbb_////_rrrr_ssss_hhhh are identical to those of _ssss_hhhh, except that the
  1091.      following are disallowed:
  1092.  
  1093.      +o  changing directory (see _c_d(1))
  1094.      +o  setting the value of $$$$PPPPAAAATTTTHHHH
  1095.      +o  specifying path or command names containing ////
  1096.      +o  redirecting output (>>>> and >>>>>>>>)
  1097.  
  1098.      The restrictions above are enforced after ._p_r_o_f_i_l_e is interpreted.
  1099.  
  1100.      A restricted shell can be invoked in one of the following ways:  (1) _r_s_h
  1101.      is the filename part of the last entry in the /_e_t_c/_p_a_s_s_w_d file (see
  1102.      _p_a_s_s_w_d(4)); (2) the environment variable SSSSHHHHEEEELLLLLLLL exists and _r_s_h is the
  1103.      filename part of its value; (3) the shell is invoked and _r_s_h is the
  1104.      filename part of argument 0; (4) the shell is invoke with the ----rrrr option.
  1105.  
  1106.      When a command to be executed is found to be a shell procedure,
  1107.      /_u_s_r/_l_i_b/_r_s_h invokes _s_h to execute it.  Thus, it is possible to provide
  1108.      to the end-user shell procedures that have access to the full power of
  1109.      the standard shell, while imposing a limited menu of commands; this
  1110.      scheme assumes that the end-user does not have write and execute
  1111.      permissions in the same directory.
  1112.  
  1113.      The net effect of these rules is that the writer of the ._p_r_o_f_i_l_e (see
  1114.      _p_r_o_f_i_l_e(4)) has complete control over user actions by performing
  1115.      guaranteed setup actions and leaving the user in an appropriate directory
  1116.  
  1117.  
  1118.  
  1119.                                                                        PPPPaaaaggggeeee 11117777
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126. bbbbsssshhhh((((1111))))                                                                  bbbbsssshhhh((((1111))))
  1127.  
  1128.  
  1129.  
  1130.      (probably _n_o_t the login directory).
  1131.  
  1132.      The system administrator often sets up a directory of commands (that is,
  1133.      /_u_s_r/_r_b_i_n) that can be safely invoked by a restricted shell.  IRIX
  1134.      provides a restricted editor, _r_e_d(1).
  1135.  
  1136. EEEEXXXXIIIITTTT SSSSTTTTAAAATTTTUUUUSSSS
  1137.      Errors detected by the shell, such as syntax errors, cause the shell to
  1138.      return a nonzero exit status.  If the shell is being used
  1139.      noninteractively execution of the shell file is abandoned.  Otherwise,
  1140.      the shell returns the exit status of the last command executed (see also
  1141.      the eeeexxxxiiiitttt command above).
  1142.  
  1143.    jjjjsssshhhh OOOOnnnnllllyyyy
  1144.      If the shell is invoked as _jjjj_ssss_hhhh and an attempt is made to exit the shell
  1145.      while there are stopped jobs, the shell issues one warning:
  1146.  
  1147.           _UUUU_XXXX_::::_jjjj_ssss_hhhh_::::_WWWW_AAAA_RRRR_NNNN_IIII_NNNN_GGGG_::::_tttt_hhhh_eeee_rrrr_eeee _aaaa_rrrr_eeee _ssss_tttt_oooo_pppp_pppp_eeee_dddd _jjjj_oooo_bbbb_ssss
  1148.  
  1149.      This is the only message.  If another exit attempt is made and there are
  1150.      still stopped jobs, they are sent a _SSSS_IIII_GGGG_HHHH_UUUU_PPPP signal from the kernel and the
  1151.      shell is exited.
  1152.  
  1153. FFFFIIIILLLLEEEESSSS
  1154.      /etc/profile
  1155.      $HOME/....profile
  1156.      /tmp/sh*
  1157.      /dev/null
  1158.  
  1159. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  1160.      cd(1), echo(1), env(1), getopts(1), intro(1), login(1), newgrp(1),
  1161.      pwd(1), systune(1m), test(1), umask(1), wait(1), xargs(1), dup(2),
  1162.      exec(2), fork(2), getrlimit(2), pipe(2), signal(2), ulimit(2),
  1163.      profile(4).
  1164.  
  1165. CCCCAAAAVVVVEEEEAAAATTTTSSSS
  1166.      Positional parameters have a range of 0 to 9.  Attempting to use the
  1167.      positional parameter $$$$11110000 gives the contents of $$$$1111 followed by a 0000, which
  1168.      is probably not the desired result.
  1169.  
  1170.      Words used for filenames in input/output redirection are not interpreted
  1171.      for filename generation (see FFFFiiiilllleeeennnnaaaammmmeeee GGGGeeeennnneeeerrrraaaattttiiiioooonnnn, above).  For example,
  1172.      ccccaaaatttt ffffiiiilllleeee1111 >>>>aaaa**** creates a file with the name aaaa****.
  1173.  
  1174.      Because commands in pipelines are run as separate processes, variables
  1175.      set in a pipeline have no effect on the parent shell.
  1176.  
  1177.      If you get the error message "cannot fork, too many processes", try using
  1178.      the _w_a_i_t(1) command to clean up your background processes.  If this
  1179.      doesn't help, the system process table is probably full or you have too
  1180.      many active foreground processes.  (There is a limit to the number of
  1181.      process ids associated with your login, and to the number the system can
  1182.  
  1183.  
  1184.  
  1185.                                                                        PPPPaaaaggggeeee 11118888
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192. bbbbsssshhhh((((1111))))                                                                  bbbbsssshhhh((((1111))))
  1193.  
  1194.  
  1195.  
  1196.      keep track of.)
  1197.  
  1198.      For compatibility with the POSIX builtin executables linked to
  1199.      /sbin/builtin_exec, the Korn shell parameter expansion
  1200.      ${parameter##pattern} has been implemented only for the specific pattern
  1201.      '*/' to emulate basename. This allows the Bourne shell builtins to work
  1202.      correctly when called with fullpaths e.g. /sbin/jobs.
  1203.  
  1204. NNNNOOOOTTTTEEEESSSS
  1205.      Sometimes, particularly when using wildcards, the shell will fail to
  1206.      execute a command, and complain with the message
  1207.         AAAArrrrgggg lllliiiisssstttt oooorrrr eeeennnnvvvviiiirrrroooonnnnmmmmeeeennnntttt ttttoooooooo llllaaaarrrrggggeeee
  1208.      This can often be avoided by using multiple commands, the _x_a_r_g_s(1)
  1209.      command, or by increasing the nnnnccccaaaarrrrggggssss kernel parameter with the
  1210.      _s_y_s_t_u_n_e(1m) command.
  1211.  
  1212. BBBBUUUUGGGGSSSS
  1213.      Only the last process in a pipeline can be waited for.
  1214.  
  1215.      If a command is executed, and a command with the same name is installed
  1216.      in a directory in the search path before the directory where the original
  1217.      command was found, the shell continues to _e_x_e_c the original command.  Use
  1218.      the hhhhaaaasssshhhh command to correct this situation.
  1219.  
  1220.      Prior to IRIX Release 5.0, the _rrrr_ssss_hhhh command invoked the restricted shell.
  1221.      This restricted shell command is _////_uuuu_ssss_rrrr_////_llll_iiii_bbbb_////_rrrr_ssss_hhhh and it can be executed by
  1222.      using the full pathname.  Beginning with IRIX Release 5.0, the _rrrr_ssss_hhhh
  1223.      command is the remote shell.  See _rrrr_ssss_hhhh______bbbb_ssss_dddd(1C).
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.                                                                        PPPPaaaaggggeeee 11119999
  1252.  
  1253.  
  1254.  
  1255.